package com.yanq.liancar.adapter;
/*
 *  @创建者     Administrator
 *  @创建时间   2018/12/6  15:08
 *  @描述       ${TODO}
 */


import android.support.annotation.Nullable;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yanq.liancar.R;
import com.yanq.liancar.bean.SelectVipVarietyBean;

import java.util.List;

public class SelectVipAdapter extends BaseQuickAdapter<SelectVipVarietyBean.DataBean,BaseViewHolder> {

    public SelectVipAdapter(int layoutResId, @Nullable List<SelectVipVarietyBean.DataBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, SelectVipVarietyBean.DataBean item) {
        helper.setText(R.id.tv_VIPprice,item.getVipvariety_name())
                .setText(R.id.tv_yuan,item.getVipvariety_price()+"");
        LinearLayout linearLayout=helper.getView(R.id.ll_content);
        TextView tv_VIPprice=helper.getView(R.id.tv_VIPprice);
        TextView tv_yuan=helper.getView(R.id.tv_yuan);
        if (item.isCkecked()){
            linearLayout.setBackground(mContext.getResources().getDrawable(R.drawable.selector_tv_bg_b));
            tv_VIPprice.setTextColor(mContext.getResources().getColor(R.color.white));
            tv_yuan.setTextColor(mContext.getResources().getColor(R.color.white));
        }else {
            linearLayout.setBackground(mContext.getResources().getDrawable(R.drawable.selector_tv_bg_a));
            tv_VIPprice.setTextColor(mContext.getResources().getColor(R.color.main_color));
            tv_yuan.setTextColor(mContext.getResources().getColor(R.color.main_color));
        }
    }
}
